var express = require('express');
var router = express.Router();
var db = require('../data');
var request = require('request');
var encryption = require('encryption');
/* GET home page. */

var randNum = function (minnum , maxnum){
    return Math.floor(minnum + Math.random() * (maxnum - minnum));
};

var GET = function(req, res, next){

    var model = db.model;

    model.user.find({}, function(err, collections){

        console.log(collections);

        var returnData = {
            leng: collections.length,
            data: collections
        }
        res.render('user', returnData);
    });

};

router.get('/', GET);

module.exports = router;
